Kanzi 3.9.10
KanziSurfaceView Class Reference

KanziSurfaceView is a specialization of SurfaceView for embedding Kanzi UI contents. More...

Inheritance diagram for KanziSurfaceView:
[legend]

Public Member Functions

 KanziSurfaceView (Context context, AttributeSet attrs)
 Constructor that is called when inflating a KanziSurfaceView from XML.
 
 KanziSurfaceView (Context context, String name)
 Constructor to use when creating a KanziSurfaceView from code.
 
void addListener (KanziViewListener listener)
 Adds state change listener for this view.
 
KanziViewAdapter getAdapter ()
 Gets the adapter of this view.
 
Domain getDomain ()
 Gets the Domain associated with this view.
 
String getName ()
 Gets the name of the view and underlying native view node.
 
Node2D getRoot ()
 Returns the root node of this view.
 
KanziRuntime getRuntime ()
 Gets the KanziRuntime associated with this view.
 
void handleOrientationChange (int orientation)
 Applies device orientation changes to the contents of this view.
 
boolean onGenericMotionEvent (MotionEvent event)
 
boolean onKeyDown (int keyCode, KeyEvent event)
 
boolean onKeyUp (int keyCode, KeyEvent event)
 
boolean onTouchEvent (MotionEvent event)
 
void removeListener (KanziViewListener listener)
 Removes state change listener from this view.
 
void setClearColor (ColorRGBA color)
 Configures the color used to clear the surface of the view before rendering its contents.
 
void setKzbPathList (String[] kzbPaths)
 Configures the list of kzb files that are loaded when the view is attached.
 
void setName (String name)
 Sets the name for the view and underlying native view node.
 
void setRoot (Node2D node)
 Sets the root node of this view, used to manually set content to the view.
 
void setStartupPrefabUrl (String url)
 Configures the startup prefab that is automatically loaded during initialization.
 

Protected Member Functions

void onAttachedToWindow ()
 
void onDetachedFromWindow ()
 
void onFocusChanged (boolean gainFocus, int direction, Rect previouslyFocusedRect)
 

Detailed Description

KanziSurfaceView is a specialization of SurfaceView for embedding Kanzi UI contents.

This view renders directly to a surface obtained from hardware composer, making it more performant, but with limited composability. See com.rightware.kanzi.SurfaceView. For more flexibly composable alternative, see com.rightware.kanzi.KanziTextureView.

Constructor & Destructor Documentation

◆ KanziSurfaceView() [1/2]

KanziSurfaceView ( Context context,
String name )

Constructor to use when creating a KanziSurfaceView from code.

Parameters
contextThe Context the view is running in, through which it can access the current theme, resources, etc.
nameA name for the underlying Kanzi view node.

◆ KanziSurfaceView() [2/2]

KanziSurfaceView ( Context context,
AttributeSet attrs )

Constructor that is called when inflating a KanziSurfaceView from XML.

Parameters
contextThe Context the view is running in, through which it can access the current theme, resources, etc.
attrsThe attributes of the XML tag that is inflating the view.

Member Function Documentation

◆ addListener()

void addListener ( KanziViewListener listener)

Adds state change listener for this view.

Parameters
listenerListener to be called when events occur.

Implements KanziView.

◆ getAdapter()

KanziViewAdapter getAdapter ( )

Gets the adapter of this view.

Returns
Kanzi view adapter of this view.

Implements KanziView.

◆ getDomain()

Domain getDomain ( )

Gets the Domain associated with this view.

Returns
Domain associated with this view.

Implements KanziView.

◆ getName()

String getName ( )

Gets the name of the view and underlying native view node.

Returns
Name of the view.

Implements KanziView.

◆ getRoot()

Node2D getRoot ( )

Returns the root node of this view.

Returns
Root node of this view.

Implements KanziView.

◆ getRuntime()

KanziRuntime getRuntime ( )

Gets the KanziRuntime associated with this view.

Returns
KanziRuntime associated with this view.

Implements KanziView.

◆ handleOrientationChange()

void handleOrientationChange ( int orientation)

Applies device orientation changes to the contents of this view.

Parameters
orientationThe orientation qualifier from onOrientationChanged().

Implements KanziView.

◆ removeListener()

void removeListener ( KanziViewListener listener)

Removes state change listener from this view.

Parameters
listenerListener to remove.

Implements KanziView.

◆ setClearColor()

void setClearColor ( ColorRGBA color)

Configures the color used to clear the surface of the view before rendering its contents.

Default value: Opaque black i.e. (0, 0, 0, 255).

Parameters
colorColor used to clear the surface of the view. Use null to skip clearing.

Implements KanziView.

◆ setKzbPathList()

void setKzbPathList ( String[] kzbPaths)

Configures the list of kzb files that are loaded when the view is attached.

Parameters
kzbPathsArray of kzb paths to load.

Implements KanziView.

◆ setName()

void setName ( String name)

Sets the name for the view and underlying native view node.

Parameters
nameNew name for the view.

Implements KanziView.

◆ setRoot()

void setRoot ( Node2D node)

Sets the root node of this view, used to manually set content to the view.

Parameters
nodeNode to be displayed in this view.

Implements KanziView.

◆ setStartupPrefabUrl()

void setStartupPrefabUrl ( String url)

Configures the startup prefab that is automatically loaded during initialization.

Parameters
urlUrl of the prefab template to load.

Implements KanziView.